\documentclass[tikz,border=2mm]{standalone}
\usepackage{array,amsmath,mathptmx,xcolor,pifont}
\usepackage{bbding}
\usepackage[UTF8]{ctex}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\usepackage{tikz-cd}
\usepackage{tikz,graphicx,subfig,caption} % Required for drawing custom shapes
\usetikzlibrary{fit,matrix,chains,arrows,shapes,positioning,arrows.meta,chains,shadows,shapes.callouts,decorations.text,shapes.symbols,shapes.misc, positioning,decorations.pathreplacing,calc,backgrounds,}

% 额外添加
\usepackage{indentfirst}
\usepackage{diagbox}
\usepackage{pifont}

\begin{document}
	\begin{tikzpicture}[>=latex,every node/.style={anchor=south west,,inner sep=0,fill=white}]
		
		\node(I0)[align=center,fill=white] at (0,0){\textcircled{0}};
		\node(I1)[align=left,fill=white] at ([xshift=3em, yshift=0.05em]I0.south){\ding{172}\_};
		\node(I2)[align=left,fill=white] at ([xshift=3em, yshift=-2em]I0.south){\ding{173}};
		\node(I3)[align=left,fill=white] at ([xshift=3em, yshift=-0.35em]I2.east){\ding{174}};
		\node(I4)[align=left,fill=white] at ([xshift=3em, yshift=-0.35em]I3.east){\ding{175}\_};
		\node(I5)[align=left,fill=white] at ([xshift=3em, yshift=-2em]I2.south){\ding{176}};
		\node(I6)[align=left,fill=white] at ([xshift=3em, yshift=-0.35em]I5.east){\ding{177}\_};
		\node(I7)[align=left,fill=black!10] at ([xshift=3em, yshift=-4em]I2.south){\ding{178}\_};
		%连接线
		\draw[->] (I0.east) -- (I1.west);
		\draw[->] (I0.south) |- (I2.west);
		\draw[->] (I2.east) -- (I3.west);
		\draw[->] (I3.east) -- (I4.west);
		\draw[->] (I2.south) |- (I5.west);
		\draw[->] (I5.east) -- (I6.west);
		\draw[->] (I2.south) |- (I7.west);
		
		\node(+)[align=center,fill=white] at ([xshift=-1.1em, yshift=-0.3em]I0.west){+};
		\node(Z)[align=center,fill=white] at ([xshift=1.5em, yshift=0.3em]I0.west){Z};
		\node(OK)[align=center,fill=white] at ([xshift=-0.5em, yshift=0em]I1.east){OK};
		\node(a)[align=center,fill=white] at ([xshift=-1.5em, yshift=0.2em]I2.west){a};
		\node(A)[align=center,fill=white] at ([xshift=-2em, yshift=0.2em]I3.west){A};
		\node(b)[align=center,fill=white] at ([xshift=-2em, yshift=0.2em]I4.west){b};
		\node(r1)[align=center,fill=white] at ([xshift=-0.5em, yshift=0em]I4.east){r(1)};
		\node(r2)[align=center,fill=white] at ([xshift=-0.5em, yshift=0em]I6.east){r(2)};
		\node(c)[align=center,fill=white] at ([xshift=-2em, yshift=0.2em]I5.west){c};
		\node(d)[align=center,fill=white] at ([xshift=-2em, yshift=0.2em]I6.west){d};
		\node(var)[align=center,fill=black!10] at ([xshift=-2em, yshift=0.2em]I7.west){$\varepsilon$};
		\node(r3_er)[align=center,fill=black!10] at ([xshift=-0.5em, yshift=0em]I7.east){r(3)};
		\node(r3)[align=center,fill=white] at ([xshift=-2.5em, yshift=-1.3em]I2.west){\textcolor{red}{r(3) \_}};
		
		\begin{pgfonlayer}{background}
			\node [draw, fill=white,fit=(I0)(I1)(I2)(I3)(I4)(I5)(I6)(I7)(r1)(r2)(r3)(Z)(+),inner sep=0.3em] {};
		\end{pgfonlayer}
		\begin{pgfonlayer}{background}
			\node [draw, fill=black!10,fit=(I7)(r3_er)(var),inner sep=0.2em] {};
		\end{pgfonlayer}
		
		\draw[red] ([xshift=0em, yshift=0.2em]var.north)--([xshift=4em, yshift=-1em]var.north);
		\draw[red] ([xshift=0em, yshift=-1em]var.north)--([xshift=4em, yshift=0.2em]var.north);
		
		
	\end{tikzpicture}
\end{document}